#ifndef MONITOR_VIEW_ACCOUNTS_H_
#define MONITOR_VIEW_ACCOUNTS_H_
#include <map>
#include <string>
#include <gtkmm/label.h>
using namespace std;
class ViewAccounts: public Gtk::Window {
private:
	Gtk::VBox box;
	Gtk::Button exit_button;
	Gtk::Notebook m_Notebook;
	Gtk::HButtonBox m_ButtonBox;
	Monitor* m;

public:

	ViewAccounts(Monitor* m) :
			exit_button("Close"), box(true, 40) {
		set_title("Registered accounts");
		this->m = m;
		set_modal(true);
		set_size_request(300, 200);
		add(box);
		m_Notebook.set_border_width(10);
		m_Notebook.set_scrollable(true);
		exit_button.signal_clicked().connect(
				sigc::mem_fun(*this, &ViewAccounts::on_exit_clicked));
		box.pack_start(m_Notebook);
		box.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);
		m_ButtonBox.pack_start(exit_button, Gtk::PACK_SHRINK);
		std::map<std::string, std::string> ma = m->GetAllAccounts();
		for (std::map<std::string, std::string>::iterator it = ma.begin();
				it != ma.end(); ++it) {
			Gtk::Label* label = new Gtk::Label("Password:" + it->second);
			m_Notebook.append_page(*label, it->first);
		}
		show_all_children();
	}

	void on_notebook_switch_page(Gtk::Widget* page, guint page_num) {

	}
	void on_exit_clicked() {
		Gtk::Main::quit();
	}

};

#endif /* MONITOR_VIEW_ACCOUNTS_H_ */
